<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算时间区间</title>
</head>
<body>
<script>
    let startTime = new Date();
    startTime.setMonth(3);
    startTime.setDate(28);

    let endTime = new Date();

    function calcDistance(start, end) {
        const result = [];
        result.push(start.toLocaleString());
        console.log(result)
    }

    calcDistance(startTime, endTime)
</script>
</body>
</html>